/*
 * @Description:
 * @Version: 2.0
 * @Autor: snzo.chen
 * @Date: 2023-11-30 16:48:45
 * @LastEditors: snzo.chen
 * @LastEditTime: 2023-12-01 17:39:22
 */
import { request } from '@/utils/request';

/**
 * 按Id查询
 * @param params {roleId}
 * @returns
 */
export function getAuthByRole(params: API.RoleAuthItem) {
  return request<API.AuthItem[]>(
    {
      url: '/roleAuth/getAuthByRole',
      method: 'get',
      params,
    },
    {
      isGetDataDirectly: true,
    },
  );
}

/**
 * 更新
 * @param data
 * @returns
 */
export function updateRoleAuth(data: API.RoleAuthItem[]) {
  return request<API.BaseResult>(
    {
      url: '/roleAuth/updateRoleAuth',
      method: 'post',
      data,
    },
    {
      isGetDataDirectly: false,
    },
  );
}
